﻿@model RequirementAndBug.Web.Models.RequireQueryConditionResponse

@{
    ViewBag.Title = "需求列表";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<<< @Html.ActionLink("更换账号", "Login", "User") | 欢迎您，尊敬的VIP用户 <span style="color: #f00">@ViewBag.UserName</span>

<h2 class="TitleBarDiv">@ViewBag.Title</h2>

@Scripts.Render("~/HtmlCommon/PageScripts/RequireList.js")
<div class="ButtonBarDiv">
    <div class="ButtonBarChildDiv">
        <input type="button" title="" value="新增" onclick="turnToPage('@Url.Action("Create", "Bug")    ')" /></div>
</div>
<div class="SearchBarDiv">
    @using (Html.BeginForm("Index", "Bug", FormMethod.Get, new { id = "searchForm" }))
    {
        <div class="SearchBarChildDiv">
            <input type="text" id="txtTitle" name="title" placeholder="按主题搜索" value="@Model.TitleKw" />
        </div>

        <div class="SearchBarChildDiv">
            <span>类型：</span>

            @Html.DropDownList("procategory", (Model.ProCategoryList == null || Model.ProCategoryList.Count == 0) ? new List<SelectListItem> { new SelectListItem { Text = "空数据源", Value = "" } } : Model.ProCategoryList)
        </div>

        <div class="SearchBarChildDiv">
            <span>阶段状态：</span>
            @Html.DropDownList("stageStatus", (Model.StageStatusList == null || Model.StageStatusList.Count == 0) ? new List<SelectListItem> { new SelectListItem { Text = "空数据源", Value = "" } } : Model.StageStatusList)
        </div>

        <div class="SearchBarChildDiv">
            <span>状态：</span>
            @Html.DropDownList("status", (Model.StatusList == null || Model.StatusList.Count == 0) ? new List<SelectListItem> { new SelectListItem { Text = "空数据源", Value = "" } } : Model.StatusList)
        </div>
                        
        <div class="SearchBarChildDiv">
            <span>指派给：</span>
            @Html.DropDownList("targetUserID", (Model.UserList == null || Model.UserList.Count == 0) ? new List<SelectListItem> { new SelectListItem { Text = "空数据源", Value = "" } } : Model.UserList)
        </div>
    
        
        <input type="hidden" name="isSumbit" value="1" />
        <input type="hidden" id="hidPageIndex" name="pageIndex" value="@Model.PageIndex" />        
        <input type="hidden" name="pageSize" value="@Model.PageSize" />
        
        <div class="SearchBarChildDiv">
            <input type="submit" title="" value="搜索" onclick="" />
        </div>
    }

    <input type="hidden" id="hidMaxPageIndex" name="maxPageIndex" value="@Model.PageCount" />
</div>

<div class="PagerBarDiv">
    <div class="PagerBarLinkDiv">
        <span class="LinkTitle">分页导航：</span>
        <a href="javascript:void(0)" onclick="changePageIndex('0')">首页</a>
        <a href="javascript:void(0)" onclick="changePageIndex('1')">上一页</a>
        <a href="javascript:void(0)" onclick="changePageIndex('2')">下一页</a>
        <a href="javascript:void(0)" onclick="changePageIndex('3')">末页</a>
    </div>
</div>

<div class="DataTableDiv">
    <table>
        <thead>
            <tr>
                <th style="width: 50px">ID</th>
                <th style="width: 680px">项目主题</th>
                <th style="width: 50px">类型</th>
                <th style="width: 75px">阶段状态</th>
                <th style="width: 70px">创建者</th>
                <th style="width: 180px">创建时间</th>
                <th style="width: 50px">状态</th>

            </tr>
        </thead>
        <tbody>
            @foreach (var p in Model.RequireList)
            {
                <tr>
                    <td>@p.RequireID</td>
                    <td title="@p.Title"><a target="_self" href="@Url.Action("Scan", "Bug", new { keyid = @p.RequireID })">@(p.Title.Length > 40 ? p.Title.Substring(0, 40) + "..." : p.Title)</a></td>
                    <td>@(p.ProCategory == 1 ? "Bug" : "需求")</td>
                    <td>
                        @if (p.StageStatus == 0)
                        {
                            @:待开发
                        }
                        else if (p.StageStatus == 1)
                        {
                            @:待测试
                        }
                        else if (p.StageStatus == 2)
                        {
                            @:待验收
                        }
                        else if (p.StageStatus == 3)
                        {
                            @:已完成
                        }
                    </td>
                    <td>@p.NickName</td>
                    <td>@p.CreateTime</td>
                    <td>@p.StatusStr</td>

                </tr>
            }
        </tbody>
    </table>
</div>
